package model;

/**
 * @author rpitts@gmu.edu
 */
public class Zone {
	
	private int dimension = 0;
	private String name = "";
	private int windowSize = 0;
	private int halfWindow = 0;
		
	public Zone(String name, int dimension, int windowSize) {
		super();
		this.name = name;
		this.dimension = dimension;
		this.windowSize = windowSize;
		if (isEven(windowSize)) this.setHalfWindow(windowSize / 2);
		else this.setHalfWindow(windowSize - 1 / 2);
	}

	private boolean isEven(int theInt) {
		if (theInt % 2 == 0) return true;
		else return false;
	}
	
	public int getDimension() {
		return this.dimension;
	}

	public int getWindowSize() {
		return this.windowSize;
	}

	public String getName() {
		return name;
	}
	
	private boolean validLocation (int theLocation) {
		return (theLocation > 0 && theLocation < dimension); 
	}	
	
	public boolean validLocation (int x, int y) {
		return (validLocation(x) && validLocation(y));
	}

	private void setHalfWindow(int halfWindow) {
		this.halfWindow = halfWindow;
	}

	public int getHalfWindow() {
		return halfWindow;
	}
}
